package com.vilen.cms.dao;

import com.vilen.basic.dao.BaseDao;
import com.vilen.cms.model.Role;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by vilen on 2015/8/24.
 */
@Repository("roleDao")
public class RoleDao extends BaseDao<Role> implements IRoleDao {
    @Override
    public List<Role> listRole() {
        return this.list("from Role");
    }

    @Override
    public void deleteRoleUsers(int rid) {
        this.updateByHql("delete UserRole ur where ur.role.id=?",rid);
    }
}
